From 1de87dbd52b0feaa3cda6cc027e22384f3d18565 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 11 Sep 2007 14:46:04 +0000 Subject: [PATCH] * Fixed notice when accessing special page without read permission and whitelist is not defined --- RELEASE-NOTES | 2 ++ includes/Title.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 28cca059c7..72e295891a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -54,6 +54,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Speed up Special:UncategorizedPages and Special:Deadendpages (no longer marked as slow queries). They now add blank ('','') entries for pages without ANY links or categories. +* Fixed notice when accessing special page without read permission and whitelist + is not defined === API changes in 1.12 === diff --git a/includes/Title.php b/includes/Title.php index e9f2e20c4e..7fc3e944a6 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1278,19 +1278,26 @@ class Title { if( $this->isSpecial( 'Userlogin' ) || $this->isSpecial( 'Resetpass' ) ) { return true; } + + /** + * Bail out if there isn't whitelist + */ + if( !is_array($wgWhitelistRead) ) { + return false; + } /** * Check for explicit whitelisting */ $name = $this->getPrefixedText(); - if( $wgWhitelistRead && in_array( $name, $wgWhitelistRead, true ) ) + if( in_array( $name, $wgWhitelistRead, true ) ) return true; /** * Old settings might have the title prefixed with * a colon for main-namespace pages */ - if( $wgWhitelistRead && $this->getNamespace() == NS_MAIN ) { + if( $this->getNamespace() == NS_MAIN ) { if( in_array( ':' . $name, $wgWhitelistRead ) ) return true; } -- 2.20.1